const { Rule, LinValidator } = require("../../core/lin-validator-v2");

const { LoginType } = require("../lib/enum");

class TokenValidator extends LinValidator {
  constructor() {
    super();
    this.account = [
      new Rule("isLength", "不符合账号规则", {
        min: 4,
        max: 32,
      }),
    ];
    this.secret = [
      new Rule("isOptional"),
      new Rule("isLength", "最少6个字符", {
        min: 6,
        max: 128,
      }),
    ];
  }
}

class NotEmptyValidator extends LinValidator {
  constructor() {
    super();
    this.token = [new Rule("isLength", "不允许为空", { min: 1 })];
  }
}

class InviteCodeValidator extends LinValidator {
  constructor() {
    super();
    this.inviteCode = [new Rule("isLength", "不允许为空", { min: 1 })];
  }
}

module.exports = {
  TokenValidator,
  NotEmptyValidator,
  InviteCodeValidator,
};
